package com.redhat.redwork.widget;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts2.views.annotations.StrutsTagAttribute;
import org.apache.struts2.views.annotations.StrutsTagSkipInheritance;

import com.opensymphony.xwork2.util.ValueStack;

public class Grid extends com.jgeppert.struts2.jquery.components.Grid{

	protected String model;
	
	public Grid(ValueStack stack, HttpServletRequest request,
			HttpServletResponse response) {
		super(stack, request, response);
	}
	
	@Override
	public void evaluateExtraParams() {
		super.evaluateExtraParams();

		if (model != null) addParameter("model", findString(model));
	}
	
	@Override
	@StrutsTagSkipInheritance
	public void setTheme(String theme) {
		super.setTheme(theme);
	}
	
	@Override
	public String getTheme() {
		return "redwork";
	}

	@StrutsTagAttribute(description="model name")
	public void setModel(String model) {
		this.model = model;
	}
}
